namespace UsefulTools.Threading
{
    using System;
    using System.Threading.Tasks;


    public interface IThreadPoolExecute
    {
        TaskScheduler ThreadPoolScheduler { get; }
    }

    public class ThreadPoolExecute : IThreadPoolExecute
    {
        public TaskScheduler ThreadPoolScheduler
        {
            get
            {
                return TaskScheduler.Default;
            }
        }
    }

    public static class ThreadingExt
    {
        public static Task<T> ToAwaitable<T>(this Func<T> func)
        {
            return Task.Run(func);
           
        }
    }

}